package com.t4l.server;

import java.net.URL;

import net.sf.json.JSONObject;

import com.t4l.shared.exceptions.T4LException;
import com.visural.common.IOUtil;

public class UserService {

	public static JSONObject authFacebookLogin(String accessToken, int expires)
			throws T4LException {
		try {
			String stringResponse = IOUtil
					.urlToString(new URL(
							"https://graph.facebook.com/me?access_token="
									+ accessToken));
			net.sf.json.JSONObject json = net.sf.json.JSONObject
					.fromObject(stringResponse);
			return json;
		} catch (Throwable ex) {
			throw new T4LException("failed login", ex);
		}
	}
}
